﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HAVTKPack
{


  public   class IsRectilinearEffectiveChanged
    {

      public static bool IsRecPointEffectiveChanged(List<int[,]> oldSign, List<int[,]> newSign)
      {
          if ((oldSign == null && newSign != null) || (oldSign != null && newSign == null))
          {
              return true;
          }
          if (oldSign == null && newSign == null)
          {
              return false;
          }
          if (oldSign.Count != newSign.Count)
          {
              return true;
          }
          if (oldSign.Count == 0 && newSign.Count == 0)
          {
              return false;
          }
          //两者 count 相等  并且不为0

          for (int i = 0; i < oldSign.Count; i++)
          {
              if ((oldSign[i] == null && newSign[i] != null) || (oldSign[i] != null && newSign[i] == null))
              {
                  return true;
              }
              else if (oldSign[i] != null && newSign[i] != null)
              {

                  if ((oldSign[i].GetLength(0) != newSign[i].GetLength(0)) || (oldSign[i].GetLength(1) != newSign[i].GetLength(1)))
                  {
                      return true;
                  }
                  else
                  {
                      for (int rows = 0; rows < oldSign[i].GetLength(0); rows++)
                      {
                          for (int cols = 0; cols < oldSign[i].GetLength(1); cols++)
                          {
                              if (oldSign[i][rows, cols] != newSign[i][rows, cols])
                              {
                                  return true;
                              }
                          }

                      }
                  }


              }
          }


          return false;
      }

    }




}
